/**
 * 
 */
package org.cuatrovientos.erp.model;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author VB
 *
 */
public class Product {

	@Min(value=1,message="{product.id.error}")
	private int id;
	
	@NotNull(message="{product.name.error}")
	private String name;
	
	@NotNull(message="{product.description.error}")
	private String description;

	@Min(value=0,message="{product.price.error}")
	private float price;
	
	@Min(value=1,message="{product.idProductType.error}")
	private int idProductType;

	/**
	 * Empty constructor
	 */
	public Product() {
		
	}

	/**
	 * Constructor using fields
	 * @param id
	 * @param name
	 * @param description
	 * @param price
	 * @param idProductType
	 */
	public Product(int id, String name, String description, float price,
			int idProductType) {
		super();
		this.id = id;
		this.name = name;
		this.description = description;
		this.price = price;
		this.idProductType = idProductType;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the price
	 */
	public float getPrice() {
		return price;
	}

	/**
	 * @param price the price to set
	 */
	public void setPrice(float price) {
		this.price = price;
	}

	/**
	 * @return the idProductType
	 */
	public int getIdProductType() {
		return idProductType;
	}

	/**
	 * @param idProductType the idProductType to set
	 */
	public void setIdProductType(int idProductType) {
		this.idProductType = idProductType;
	}
}
